import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class NormalEdit extends StatelessWidget {
  const NormalEdit({
    super.key,
    this.text,
    this.fontSize,
    this.fontColor,
    this.maxLength,
    this.hintText,
    this.hintFontSize,
    this.hintFontColor,
    this.controller,
    this.inputType,
    this.onChanged,
    this.inputFormatters,
    this.padding,
  });

  final String? text;
  final double? fontSize;
  final Color? fontColor;
  final int? maxLength;
  final String? hintText;
  final double? hintFontSize;
  final Color? hintFontColor;
  final TextEditingController? controller;
  final TextInputType? inputType;
  final ValueChanged<String>? onChanged;
  final List<TextInputFormatter>? inputFormatters;
  final EdgeInsets? padding;

  @override
  Widget build(BuildContext context) {
    return TextField(
      inputFormatters: inputFormatters,
      maxLength: maxLength,
      keyboardType: inputType,
      controller: controller,
      onChanged: onChanged,
      style: TextStyle(
        fontSize: fontSize,
        color: fontColor,
      ),
      decoration: InputDecoration(
        isDense: padding != null,
        contentPadding: padding,
        hintText: hintText,
        hintStyle: TextStyle(
          color: hintFontColor,
          fontSize: hintFontSize ?? fontSize,
        ),
        border: InputBorder.none,
        counterText: "",
      ),
    );
  }
}
